using System;

namespace SharpMud.Net.Telnet.ANSI
{
	public enum BasicColor
	{
		Black			=30,
		Red				=31,
		Green			=32,
		Yellow			=33,
		Blue			=34,
		Magenta			=35,
		Cyan			=36,
		
        Gray			=37,
        //White           =Gray,

        Default			=39
	}

    /// <summary>
    /// The set of text foreground colors supported by ANSI
    /// </summary>
    public enum ForegroundColor
    {
        [AnsiRepresentation(BasicColor.Black, ColorScope.Foreground, false)]
        Black = SharpMud.Terminal.TerminalColor.Black,

        [AnsiRepresentation(BasicColor.Blue, ColorScope.Foreground, false)]
        DarkBlue = SharpMud.Terminal.TerminalColor.DarkBlue,

        [AnsiRepresentation(BasicColor.Cyan, ColorScope.Foreground, false)]
        DarkCyan = SharpMud.Terminal.TerminalColor.DarkCyan,

        [AnsiRepresentation(BasicColor.Green, ColorScope.Foreground, false)]
        DarkGreen = SharpMud.Terminal.TerminalColor.DarkGreen,

        [AnsiRepresentation(BasicColor.Magenta, ColorScope.Foreground, false)]
        DarkMagenta = SharpMud.Terminal.TerminalColor.DarkMagenta,

        [AnsiRepresentation(BasicColor.Red, ColorScope.Foreground, false)]
        DarkRed = SharpMud.Terminal.TerminalColor.DarkRed,

        [AnsiRepresentation(BasicColor.Yellow, ColorScope.Foreground, false)]
        DarkYellow = SharpMud.Terminal.TerminalColor.DarkYellow,

        [AnsiRepresentation(BasicColor.Gray, ColorScope.Foreground, false)]
        Gray = SharpMud.Terminal.TerminalColor.Gray,

        [AnsiRepresentation(BasicColor.Green, ColorScope.Foreground, true)]
        Green = SharpMud.Terminal.TerminalColor.Green,

        [AnsiRepresentation(BasicColor.Magenta, ColorScope.Foreground, true)]
        Magenta = SharpMud.Terminal.TerminalColor.Magenta,

        [AnsiRepresentation(BasicColor.Red, ColorScope.Foreground, true)]
        Red = SharpMud.Terminal.TerminalColor.Red,

        [AnsiRepresentation(BasicColor.Gray, ColorScope.Foreground, true)]
        White = SharpMud.Terminal.TerminalColor.White,

        [AnsiRepresentation(BasicColor.Yellow, ColorScope.Foreground, true)]
        Yellow = SharpMud.Terminal.TerminalColor.Yellow,

        [AnsiRepresentation(BasicColor.Blue, ColorScope.Foreground, true)]
        Blue = SharpMud.Terminal.TerminalColor.Blue,

        [AnsiRepresentation(BasicColor.Cyan, ColorScope.Foreground, true)]
        Cyan = SharpMud.Terminal.TerminalColor.Cyan,

        [AnsiRepresentation(BasicColor.Black, ColorScope.Foreground, true)]
        DarkGray = SharpMud.Terminal.TerminalColor.DarkGray,

        [AnsiRepresentation(BasicColor.Default, ColorScope.Foreground, false)]
        Default,
    }

    /// <summary>
    /// The set of text background colors supported by ANSI
    /// </summary>
    public enum BackgroundColor
    {
        [AnsiRepresentation(BasicColor.Black,ColorScope.Background)]
        Black = SharpMud.Terminal.TerminalColor.Black,

        [AnsiRepresentation(BasicColor.Blue,ColorScope.Background)]
        Blue = SharpMud.Terminal.TerminalColor.DarkBlue,
        
        [AnsiRepresentation(BasicColor.Cyan,ColorScope.Background)]
        Cyan = SharpMud.Terminal.TerminalColor.DarkCyan,

        [AnsiRepresentation(BasicColor.Gray, ColorScope.Background)]
        Gray = SharpMud.Terminal.TerminalColor.Gray,

        [AnsiRepresentation(BasicColor.Green, ColorScope.Background)]
        Green = SharpMud.Terminal.TerminalColor.DarkGreen,
        
        [AnsiRepresentation(BasicColor.Magenta, ColorScope.Background)]
        Magenta = SharpMud.Terminal.TerminalColor.DarkMagenta,

        [AnsiRepresentation(BasicColor.Red, ColorScope.Background)]
        Red = SharpMud.Terminal.TerminalColor.DarkRed,

        [AnsiRepresentation(BasicColor.Yellow, ColorScope.Background)]
        Yellow = SharpMud.Terminal.TerminalColor.DarkYellow,

        [AnsiRepresentation(BasicColor.Default, ColorScope.Background)]
        Default,
    }

	/// <summary>
	/// The basic set of colors, differentiated by foreground and background values
	/// </summary>
    internal enum ScopedColor
	{
		//Foreground color
		FG_Black		=BasicColor.Black,
		FG_Red			=BasicColor.Red,
		FG_Green		=BasicColor.Green,
		FG_Yellow		=BasicColor.Yellow,
		FG_Blue			=BasicColor.Blue,
		FG_Magenta		=BasicColor.Magenta,
		FG_Cyan			=BasicColor.Cyan,
		FG_White		=BasicColor.Gray,
		FG_Default		=BasicColor.Default,

		//Background color
		BG_Black		=10+(int)BasicColor.Black,
		BG_Red			=10+(int)BasicColor.Red,
		BG_Green		=10+(int)BasicColor.Green,
		BG_Yellow		=10+(int)BasicColor.Yellow,
		BG_Blue			=10+(int)BasicColor.Blue,
		BG_Magenta		=10+(int)BasicColor.Magenta,
		BG_Cyan			=10+(int)BasicColor.Cyan,
		BG_White		=10+(int)BasicColor.Gray,
		BG_Default		=10+(int)BasicColor.Default
	}

    /// <summary>
    /// Used to designate if an accompanying color value is for foreground or background
    /// </summary>
    public enum ColorScope
    {
        Foreground=0,
        Background=10
    }
}
